import {
  request
} from './axios-config'
const ROUTING = '/sys/routing/'
const INFO = '/sys/info/'

// 按照类型得到标题和选项
export function getRegisterTitles(params) {
  return request({
    url: ROUTING + 'register/titles',
    params,
    method: 'get'
  })
}

// 根据条件查询沿街店家列表
export function getStoreList(params) {
  return request({
    url: INFO + 'store/list',
    params,
    method: 'get'
  })
}

// 根据条件查询建筑工地列表
export function getSiteList(params) {
  return request({
    url: INFO + 'construction/site/list',
    params,
    method: 'get'
  })
}

// 根据条件查询物业公司列表
export function getCompanyList(params) {
  return request({
    url: INFO + 'proper/company/property-companys',
    params,
    method: 'get'
  })
}

// 添加巡检记录
export function submitInspectionResult({
  data,
  params
}) {
  return request({
    url: ROUTING + 'register/common-unit-result',
    data,
    params,
    method: 'post',
    headers: {
      'Content-Type': 'application/json; charset=utf-8'
    }
  })
}

// 按照巡检id得到巡检选项结果
export function getRegisterDetail(params) {
  return request({
    url: ROUTING + 'register/register-options',
    params,
    method: 'get'
  })
}

// 根据条件查询店家巡检记录
export function getStoreRecordList(params) {
  return request({
    url: ROUTING + 'register/shop-registers',
    params,
    method: 'get'
  })
}

// 根据条件查询工地巡检记录
export function getSiteRecordList(params) {
  return request({
    url: ROUTING + 'register/site-registers',
    params,
    method: 'get'
  })
}

// 根据条件查询物业公司列表
export function getCompanyRecordList(params) {
  return request({
    url: ROUTING + 'register/company-registers',
    params,
    method: 'get'
  })
}